/*
 *  Copyright (c) 2022 ZhuHai Jieli Technology Co.,Ltd.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

#ifndef A2DP_MEDIA_CODEC_H
#define A2DP_MEDIA_CODEC_H

#include "generic/typedef.h"

#define seqn_after(a, b)        ((s16)((s16)(b) - (s16)(a)) < 0)
#define seqn_before(a, b)       seqn_after(b, a)

extern int a2dp_media_get_packet(u8 **frame);

extern int a2dp_media_try_get_packet(u8 **frame);

extern int a2dp_media_get_remain_buffer_size(void);

extern int a2dp_media_get_remain_play_time(u8 include_tws);

extern int a2dp_media_get_total_data_len(void);

extern int a2dp_media_get_packet_num(void);

extern int a2dp_media_clear_packet_before_seqn(u16 seqn_number);

extern void *a2dp_media_fetch_packet(int *len, void *prev_packet);

extern void *a2dp_media_fetch_packet_and_wait(int *len, void *prev_packet, int msec);

extern void a2dp_media_free_packet(void *_packet);

extern int a2dp_media_channel_exist(void);

extern int a2dp_media_is_clearing_frame(void);

extern int a2dp_media_get_codec_type(void);

#endif
